#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void bubble_sort(int arr[], int sz)
{
	for (int i = 0;i < sz - 1;i++)
	{
		int flag = 1;
		for (int j = 0;j < sz - 1 - i;j++)
		{
			if (arr[j] < arr[j + 1])
			{
				int temp = 0;
				temp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = temp;
				flag = 0;
			}
		}
		if (flag == 1)
		{
			break;
		}
	}
}
void print(int* p, int sz)
{
	for (int i = 0;i < sz;i++)
	{
		printf("%d ", *(p + i));
	}
}
int main()
{
	int arr[10] = { 9,10,8,7,6,5,4,3,2,1 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	bubble_sort(arr,sz);
		print(arr,sz);
	return 0;
}